﻿using System.Data;
using System.Data.SqlClient;

namespace UniversityStudentManagemnetSystem.DAO.DAL.Gateway
{
    public class BuildingGateway:DAO.Gateway.Gateway
    {
        public DataTable GetAllBuildings()
        {
            string selectQuery = string.Format("select * from t_Building");
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectQuery, GetConnectionString());
            DataSet dataSet = new DataSet();
            sqlDataAdapter.Fill(dataSet, "BuildingTable");
            DataTable myDataTable = dataSet.Tables["BuildingTable"];
            return myDataTable;
        }
    }
}